package com.example.task.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.task.entity.CartItem;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CartItemDao extends BaseMapper<CartItem> {
    @Select("select * from t_cart_item where cid=#{cid} and gid=#{gid}")
    CartItem selectByCid(@Param("cid") long cid, @Param("gid") long gid);
    @Update("update t_cart_item set num=#{num} where id=#{id}")
    int updateNum(@Param("num") int num,@Param("id") long id);
    //批处理
    int delBatch(List<Long> ids);
}
